package cn.edu.sjtu.se.dslab.component.design.generate.element;

import java.util.Map;

public class DynamicVar extends PageElement {

	public static final String X_COORDINATE = "x_coordinate";
	public static final String Y_COORDINATE = "y_coordinate";
	public static final String VAR_ID = "var_id";
	public static final String VAR_FORMULA = "var_formula";

	private long varId;
	private String varFormula;
	private int xCoordinate;
	private int yCoordinate;
	
	private int varName;

	public DynamicVar(Map<String, String> elementMap) {
		super.setElementName(elementMap.get(ELEMENT_NAME));
		super.setElementType(ElementType.valueOf(elementMap.get(ELEMENT_TYPE).toUpperCase()));
		varId = Long.parseLong(elementMap.get(VAR_ID));
		varFormula = elementMap.get(VAR_FORMULA);
		xCoordinate = Integer.parseInt(elementMap.get(X_COORDINATE));
		yCoordinate = Integer.parseInt(elementMap.get(Y_COORDINATE));
	}


	public long getVarId() {
		return varId;
	}


	public void setVarId(long varId) {
		this.varId = varId;
	}


	public String getVarFormula() {
		return varFormula;
	}


	public void setVarFormula(String varFormula) {
		this.varFormula = varFormula;
	}


	public int getxCoordinate() {
		return xCoordinate;
	}

	public void setxCoordinate(int xCoordinate) {
		this.xCoordinate = xCoordinate;
	}

	public int getyCoordinate() {
		return yCoordinate;
	}

	public void setyCoordinate(int yCoordinate) {
		this.yCoordinate = yCoordinate;
	}

}
